//
//  HKUIKitViewController.m
//  HKiOSTools
//
//  Created by 胡锦涛 on 2020/12/22.
//

#import "HKUIKitViewController.h"
#import "HKThemeViewController.h"
@interface HKUIKitViewController ()

@end

@implementation HKUIKitViewController

- (void)initDataSource {
    self.dataSource = [[QMUIOrderedDictionary alloc] initWithKeysAndObjects:
                       @"QMUITheme", UIImageMake(@"icon_grid_button"),
                       @"QMUIConsole", UIImageMake(@"icon_grid_label"),
                       @"QMUINavigationController", UIImageMake(@"icon_grid_navigation"),
                       @"ViewController Orientation", UIImageMake(@"icon_grid_orientation"),
                       @"QMUITextView", UIImageMake(@"icon_grid_textView"),
                       nil];
//
//    @"QMUITextField", UIImageMake(@"icon_grid_textField"),
//    @"QMUISlider", UIImageMake(@"icon_grid_slider"),
//    @"QMUIAlertController", UIImageMake(@"icon_grid_alert"),
//    @"QMUITableView", UIImageMake(@"icon_grid_cell"),
//
//    @"QMUINavigationController", UIImageMake(@"icon_grid_navigation"),
//    @"UISearchBar+QMUI", UIImageMake(@"icon_grid_search"),
//    @"UITabBarItem+QMUI", UIImageMake(@"icon_grid_tabBarItem"),
//    @"UIColor+QMUI", UIImageMake(@"icon_grid_color"),
//    @"UIImage+QMUI", UIImageMake(@"icon_grid_image"),
//    @"UIImageView+QMUI", UIImageMake(@"icon_grid_imageView"),
//    @"UIFont+QMUI", UIImageMake(@"icon_grid_font"),
//    @"UIControl+QMUI", UIImageMake(@"icon_grid_control"),
//    @"UIView+QMUI", UIImageMake(@"icon_grid_view"),
//    @"NSObject+QMUI", UIImageMake(@"icon_grid_nsobject"),
//    @"CAAnimation+QMUI", UIImageMake(@"icon_grid_caanimation"),
}

- (void)setupNavigationItems {
    [super setupNavigationItems];
    self.title = @"QMUIKit";
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem qmui_itemWithImage:UIImageMake(@"icon_nav_about") target:self action:@selector(handleAboutItemEvent)];
    AddAccessibilityLabel(self.navigationItem.rightBarButtonItem, @"打开关于界面");
}

- (void)didSelectCellWithTitle:(NSString *)title {
    //主题切换演示VC
    [self.navigationController qmui_pushViewController:[HKThemeViewController new] animated:YES completion:nil];
}

- (void)handleAboutItemEvent {
    QMUIThemeManagerCenter.defaultThemeManager.currentThemeIdentifier = HKThemeIdentifierGrapefruit;
}

@end
